# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
pkgname=purpose5
pkgver=5.113.0
pkgrel=0
pkgdesc="Framework for providing abstractions to get the developer's purposes fulfilled"
# armhf blocked by extra-cmake-modules
# ppc64le, s390x and riscv64 blocked by qt5-qtwebengine -> kaccounts-integration
arch="all !armhf !ppc64le !s390x !riscv64"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-or-later"
depends_dev="
	kaccounts-integration-dev
	kconfig5-dev
	kcoreaddons5-dev
	ki18n5-dev
	kio5-dev
	kirigami2-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
checkdepends="xvfb-run"
_repo_url="https://invent.kde.org/frameworks/purpose.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/purpose-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"
options="!check" # fails on builders
builddir="$srcdir/purpose-$pkgver"

replaces="purpose<=5.110.0-r0"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_TESTING=ON
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure -E 'menutest'
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
df7f2b3164caa474100731eb360318c2a6bb8301aeb0729fab3824d95f123ece00e74032c2533ce477c92717c116404ed56f7c320320557c29a5036ecf135f7e  purpose-5.113.0.tar.xz
"
